package com.atjinggu.jinggumail.member.web.controller;

import com.atjinggu.jinggumail.common.utils.R;
import com.atjinggu.jinggumail.member.feign.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author jingming
 * @Type MemberOrderController.java
 * @Desc
 * @date 2021/3/22 14:47
 */
@Controller
public class MemberOrderController {

    @Autowired
    OrderFeignService orderFeignService;

    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum, Model model){
       R r =  orderFeignService.listOrderItem(pageNum);
        System.out.println(r);
        model.addAttribute("orders",r);
        return "index";
    }
}